home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5UTL011.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
3KB
|
69 lines
If you use a delayed-write cache such as SmartDrive, batch
files that write to disk then reboot your system don't work.
I discovered this the hard way; luckily, I also discovered a
solution.
I boot with different AUTOEXEC.BAT and CONFIG.SYS files,
depending on whether I'm going to run Windows. To make this
easier, I have a batch file, GO.BAT, that swaps my
AUTOEXEC.BAT and CONFIG.SYS files, then reboots the system
using WARMBOOT.COM (see "Batching the Warm Boot," User Group
Tips, July 1992). This worked well until I installed Windows
3.1, which automatically adds SmartDrive to the system.
Since SmartDrive waits before writing files to disk, my
batch file would reboot the computer before it had copied my
files. The result? My system would reboot with the same
AUTOEXEC.BAT and CONFIG.SYS as before.
My solution is to place three lines at the beginning of the
batch file:
---- BEGIN LISTING ----
@ECHO OFF
SMARTDRV /C
SMARTDRV C
---- END LISTING ----
The second line writes all cached data to disk; the third
turns off write-behind caching for drive C:. This ensures
that the copy command completes its duties before the system
reboots.
William H. McWilliams
Uniontown, Pennsylvania
Editor's Note: An unflushed cache -- that is, one that holds
data that still needs to be written to the disk -- creates a
very real problem for batch files and programs that
reconfigure and reboot your computer: They often fail to
function as expected and may even leave you without a
CONFIG.SYS or AUTOEXEC.BAT file. This situation crops up on
machines running SmartDrive, Norton's NCACHE, PowerCache
Plus, and other caches that feature delayed writes (also
called write-back or write-behind). It also poses a danger:
If you shut off your PC too soon after performing a file
operation, the results can be lost and the hard disk can be
corrupted. Mr. McWilliams' approach (which I also use on my
system) solves the problem, at least in situations where
software causes the machine to reboot.
If you're concerned with shutting off your PC before cached
data has been written to disk, simply place his batch
fragment in a file called SHUTDOWN.BAT and then run the
batch file before you turn your machine off. If you're using
SmartDrive, you can use the Alt-F command to copy Mr.
McWilliams' commands to a file for your own use. Note that
if you're running a cache other than SmartDrive, the
commands needed to flush and disable the cache will be
different, but they almost always consist of the name of the
caching program followed by a command or command switch.
Consult your cache's manual to find the correct command.
Title: When SmartDrive Gets Too Smart
Category: UTL
Issue Date: November, 1992
Editor: Brett Glass
Supplementary Files: None
Filename: P5UTL011.TIP